package com.proyecto.poo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Cuadrilatero extends Activity {

	 /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.cuadrado);
        
        
        Button botonCalcular = (Button)findViewById(R.id.button1);
        final EditText baseCuadrilatero = (EditText)findViewById(R.id.editText1);
        final EditText alturaCuadrilatero = (EditText)findViewById(R.id.editText2);
        
        botonCalcular.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				
				float baseGood=0f;
				float alturaGood=0f;
				
				String base = baseCuadrilatero.getText().toString();
				String altura = alturaCuadrilatero.getText().toString();
				
				baseGood = Float.parseFloat(base);
				alturaGood = Float.parseFloat(altura);
				
				Intent intent = new Intent();
				intent.putExtra("BaseCuadrilatero", baseGood);
				intent.putExtra("AlturaCuadrilatero", alturaGood);
                intent.setClass(Cuadrilatero.this,CuadrilateroRes.class);
                startActivity(intent);
               
			}
		});
        
    }
	
	
	
	
}
